const mongoose = require("../conf/db");

const fileSchema = new mongoose.Schema(
  {
    // 文件原始名字
    originalname: {
      type: String,
      required: true
    },

    // 文件名
    filename: {
      type: String,
      required: true
    },

    // 文件类型
    mimetype: {
      type: String,
      required: true
    },

    // 文件大小
    size: {
      type: Number,
      required: true
    }
  },
  { timestamps: true }
);

module.exports = mongoose.model("file", fileSchema);
